// $ANTLR 3.4 C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g 2012-10-24 19:31:33

  package practica6;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class AnalexParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "BLANCO", "DIGITO", "DIV", "MAS", "MENOS", "MULT", "NUMERO", "PARENTESIS_A", "PARENTESIS_C", "SEPARADOR"
    };

    public static final int EOF=-1;
    public static final int BLANCO=4;
    public static final int DIGITO=5;
    public static final int DIV=6;
    public static final int MAS=7;
    public static final int MENOS=8;
    public static final int MULT=9;
    public static final int NUMERO=10;
    public static final int PARENTESIS_A=11;
    public static final int PARENTESIS_C=12;
    public static final int SEPARADOR=13;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public AnalexParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public AnalexParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return AnalexParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g"; }


         private ArrayList<RecognitionException> errors = new ArrayList<RecognitionException>();
         public ArrayList<RecognitionException> getErrors() {
            return errors;
         }
         @Override
         public void reportError (RecognitionException e) {
            String msg = getErrorMessage(e, getTokenNames());
            System.err.println(msg);
            errors.add(e);
         }



    // $ANTLR start "entrada"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:26:1: entrada : instrucciones ;
    public final void entrada() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:26:9: ( instrucciones )
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:26:11: instrucciones
            {
            pushFollow(FOLLOW_instrucciones_in_entrada48);
            instrucciones();

            state._fsp--;


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "entrada"



    // $ANTLR start "instrucciones"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:28:1: instrucciones : ( instruccion )* ;
    public final void instrucciones() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:28:15: ( ( instruccion )* )
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:28:17: ( instruccion )*
            {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:28:17: ( instruccion )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( ((LA1_0 >= NUMERO && LA1_0 <= PARENTESIS_A)) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:28:18: instruccion
            	    {
            	    pushFollow(FOLLOW_instruccion_in_instrucciones57);
            	    instruccion();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instrucciones"



    // $ANTLR start "instruccion"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:30:1: instruccion : exp SEPARADOR ;
    public final void instruccion() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:30:13: ( exp SEPARADOR )
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:30:15: exp SEPARADOR
            {
            pushFollow(FOLLOW_exp_in_instruccion67);
            exp();

            state._fsp--;


            match(input,SEPARADOR,FOLLOW_SEPARADOR_in_instruccion69); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instruccion"



    // $ANTLR start "exp"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:32:1: exp : exp_mult ( ( MAS | MENOS ) exp_mult )* ;
    public final void exp() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:32:5: ( exp_mult ( ( MAS | MENOS ) exp_mult )* )
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:32:7: exp_mult ( ( MAS | MENOS ) exp_mult )*
            {
            pushFollow(FOLLOW_exp_mult_in_exp77);
            exp_mult();

            state._fsp--;


            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:32:16: ( ( MAS | MENOS ) exp_mult )*
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( ((LA2_0 >= MAS && LA2_0 <= MENOS)) ) {
                    alt2=1;
                }


                switch (alt2) {
            	case 1 :
            	    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:32:17: ( MAS | MENOS ) exp_mult
            	    {
            	    if ( (input.LA(1) >= MAS && input.LA(1) <= MENOS) ) {
            	        input.consume();
            	        state.errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        throw mse;
            	    }


            	    pushFollow(FOLLOW_exp_mult_in_exp86);
            	    exp_mult();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp"



    // $ANTLR start "exp_mult"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:34:1: exp_mult : exp_base ( ( MULT | DIV ) exp_base )* ;
    public final void exp_mult() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:34:10: ( exp_base ( ( MULT | DIV ) exp_base )* )
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:34:12: exp_base ( ( MULT | DIV ) exp_base )*
            {
            pushFollow(FOLLOW_exp_base_in_exp_mult97);
            exp_base();

            state._fsp--;


            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:34:21: ( ( MULT | DIV ) exp_base )*
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==DIV||LA3_0==MULT) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:34:22: ( MULT | DIV ) exp_base
            	    {
            	    if ( input.LA(1)==DIV||input.LA(1)==MULT ) {
            	        input.consume();
            	        state.errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        throw mse;
            	    }


            	    pushFollow(FOLLOW_exp_base_in_exp_mult106);
            	    exp_base();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp_mult"



    // $ANTLR start "exp_base"
    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:36:1: exp_base : ( NUMERO | PARENTESIS_A exp PARENTESIS_C );
    public final void exp_base() throws RecognitionException {
        try {
            // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:36:10: ( NUMERO | PARENTESIS_A exp PARENTESIS_C )
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==NUMERO) ) {
                alt4=1;
            }
            else if ( (LA4_0==PARENTESIS_A) ) {
                alt4=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;

            }
            switch (alt4) {
                case 1 :
                    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:36:12: NUMERO
                    {
                    match(input,NUMERO,FOLLOW_NUMERO_in_exp_base117); 

                    }
                    break;
                case 2 :
                    // C:\\Users\\usuario\\workspace\\Practica6-PL\\src\\main\\java\\practica6\\AnalexParser.g:36:21: PARENTESIS_A exp PARENTESIS_C
                    {
                    match(input,PARENTESIS_A,FOLLOW_PARENTESIS_A_in_exp_base121); 

                    pushFollow(FOLLOW_exp_in_exp_base123);
                    exp();

                    state._fsp--;


                    match(input,PARENTESIS_C,FOLLOW_PARENTESIS_C_in_exp_base125); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "exp_base"

    // Delegated rules


 

    public static final BitSet FOLLOW_instrucciones_in_entrada48 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_instruccion_in_instrucciones57 = new BitSet(new long[]{0x0000000000000C02L});
    public static final BitSet FOLLOW_exp_in_instruccion67 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_SEPARADOR_in_instruccion69 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_exp_mult_in_exp77 = new BitSet(new long[]{0x0000000000000182L});
    public static final BitSet FOLLOW_set_in_exp80 = new BitSet(new long[]{0x0000000000000C00L});
    public static final BitSet FOLLOW_exp_mult_in_exp86 = new BitSet(new long[]{0x0000000000000182L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult97 = new BitSet(new long[]{0x0000000000000242L});
    public static final BitSet FOLLOW_set_in_exp_mult100 = new BitSet(new long[]{0x0000000000000C00L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult106 = new BitSet(new long[]{0x0000000000000242L});
    public static final BitSet FOLLOW_NUMERO_in_exp_base117 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PARENTESIS_A_in_exp_base121 = new BitSet(new long[]{0x0000000000000C00L});
    public static final BitSet FOLLOW_exp_in_exp_base123 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_PARENTESIS_C_in_exp_base125 = new BitSet(new long[]{0x0000000000000002L});

}